/* Apple风格样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: #333;
    line-height: 1.6;
}

.app-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 紧凑标题栏 */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 12px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}

.header h1 {
    font-size: 22px;
    font-weight: 600;
    color: #1d1d1f;
    margin: 0 0 4px 0;
}

.subtitle {
    color: #86868b;
    font-size: 14px;
    margin: 0;
}

/* 主要内容 - 两列布局 */
.main-content {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 20px;
    overflow: hidden;
}

.left-column,
.right-column {
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow: hidden;
}

/* 区域标题 */
section h2, .right-column h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1d1d1f;
    margin: 0 0 12px 0;
}

/* 文件选择区域 */
.file-selection {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    flex-shrink: 0;
}

.selection-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background: #007AFF;
    color: white;
}

.btn-primary:hover {
    background: #0056CC;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 122, 255, 0.3);
}

.btn-success {
    background: #34C759;
    color: white;
    font-size: 16px;
    padding: 12px 24px;
}

.btn-secondary {
    background: #6C757D;
    color: white;
}

.btn-secondary:hover {
    background: #5A6268;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.3);
}

.btn-success:hover:not(:disabled) {
    background: #28A745;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(52, 199, 89, 0.3);
}

.btn:disabled {
    background: #E5E5E7;
    color: #86868B;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 拖拽区域 */
.drop-zone {
    border: 2px dashed #D1D1D6;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    background: #F2F2F7;
    transition: all 0.3s ease;
}

.drop-zone.drag-over {
    border-color: #007AFF;
    background: rgba(0, 122, 255, 0.05);
}

.drop-content {
    pointer-events: none;
}

.drop-icon {
    font-size: 32px;
    display: block;
    margin-bottom: 8px;
}

.drop-zone p {
    font-size: 14px;
    color: #1D1D1F;
    margin: 0;
}

/* 路径列表 */
.path-list {
    background: #E8F4FD;
    border-radius: 8px;
    padding: 15px;
    flex-shrink: 0;
}

.path-items {
    max-height: 100px;
    overflow-y: auto;
    margin-bottom: 8px;
    padding-right: 5px; /* 为滚动条留出空间 */
}

/* 路径列表滚动条样式 */
.path-items::-webkit-scrollbar {
    width: 6px;
}

.path-items::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.path-items::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.path-items::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.path-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 10px;
    background: white;
    border-radius: 6px;
    margin-bottom: 4px;
    font-size: 12px;
}

.path-item .path-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.path-item .remove-path {
    background: #FF3B30;
    color: white;
    border: none;
    border-radius: 3px;
    padding: 2px 6px;
    font-size: 10px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.path-item .remove-path:hover {
    background: #D70015;
}

/* 文件列表 */
.file-list {
    background: #F2F2F7;
    border-radius: 8px;
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-height: 400px; /* 设置最大高度以确保滚动生效 */
}

.file-items {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 10px;
    max-height: 320px; /* 为文件项设置最大高度 */
    padding-right: 5px; /* 为滚动条留出空间 */
}

/* 自定义滚动条样式 */
.file-items::-webkit-scrollbar {
    width: 6px;
}

.file-items::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.file-items::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.file-items::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: white;
    border-radius: 6px;
    margin-bottom: 3px;
    font-size: 12px;
}

.remove-file {
    background: #ff4757;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 10px;
    cursor: pointer;
    margin-left: auto;
    flex-shrink: 0;
    transition: background-color 0.2s;
}

.remove-file:hover {
    background: #ff3838;
}

.file-stats {
    font-size: 12px;
    color: #86868B;
    text-align: center;
    flex-shrink: 0;
}

/* 设置区域 */
.settings {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    flex-shrink: 0;
}

.settings-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.checkbox-group {
    flex-direction: row !important;
    gap: 15px !important;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}

.setting-item label {
    font-weight: 500;
    color: #1D1D1F;
    font-size: 14px;
}

.setting-item input,
.setting-item select {
    padding: 8px;
    border: 1px solid #D1D1D6;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    transition: border-color 0.2s ease;
}

.setting-item input:focus,
.setting-item select:focus {
    outline: none;
    border-color: #007AFF;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.setting-item input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

.setting-hint {
    font-size: 12px;
    color: #86868B;
    font-style: italic;
    margin-top: 4px;
}

/* 预览区域 */
.preview {
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.preview-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 10px;
    font-size: 12px;
    color: #86868B;
    flex-shrink: 0;
}

.preview-content {
    background: #F2F2F7;
    border-radius: 8px;
    padding: 12px;
    flex: 1;
    overflow-y: auto;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: 11px;
    line-height: 1.3;
    max-height: 300px; /* 设置最大高度确保滚动生效 */
}

/* 预览内容滚动条样式 */
.preview-content::-webkit-scrollbar {
    width: 6px;
}

.preview-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.preview-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.preview-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 生成按钮区域 */
.generate-section {
    text-align: center;
    flex-shrink: 0;
}

/* 模态框 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.progress-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #E5E5E7;
    border-top: 3px solid #007AFF;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 状态栏 */
.status-bar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 10px 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    font-size: 14px;
    color: #86868B;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .left-column,
    .right-column {
        max-height: none;
    }

    .app-container {
        height: auto;
        min-height: 100vh;
    }

    .main-content {
        overflow: visible;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 15px;
    }

    .selection-buttons {
        flex-direction: column;
        gap: 8px;
    }

    .settings-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .preview-stats {
        flex-direction: column;
        gap: 8px;
    }

    .checkbox-group {
        flex-direction: column !important;
        gap: 8px !important;
    }
}
